<template>
	<view style='padding:15px;'>
		<u--form :model="formSearch" ref="form1">

			<u-form-item label="方案名称" prop="schemeName" @click="showSex = true;" labelWidth='150'>
				<u--input v-model="formSearch.schemeName" placeholder="请选择方案名称">
				</u--input>
			</u-form-item>
			<u-form-item label="执行日期" prop="executionDate" labelWidth='150' @click="showDate = true;">
				<uni-datetime-picker :show="showDate" @close='showDate = false;' v-model="formSearch.executionDate"
					type="daterange" />
			</u-form-item>
		</u--form>

		<u-button style='margin:15px auto;width:80%;' type="primary" size="large" @click="btnSearch()">查询</u-button>
		<u-button style='margin:15px auto;width:80%;' type="primary" size="large" @click="btnReset()">重置</u-button>
	</view>
</template>
<script>
	export default {
		components: {},
		data() {
			return {
				formSearch: {
					schemeName: "",
					executionDate: "",
					beginTime: "",
					endTime: ""
				},
				showDate: false,
			}
		},
		onLoad() {},
		methods: {
			// 查询
			btnSearch() {
				this.formSearch.beginTime = this.formSearch.executionDate[0]
				this.formSearch.endTime = this.formSearch.executionDate[1]
				delete this.formSearch.executionDate
				this.$goBack('./index?direction=2&formSearch=' + encodeURIComponent(JSON.stringify(this.formSearch)),
					5);
			},


			// 重置
			btnReset() {
				this.$refs.form1.resetFields()
			}


		}
	}
</script>

<style lang="scss" scoped>
</style>
